import request from "../utils/request";

//登陆功能
export function toLogin(data) {
    return request({
        url: '/user/Login',
        method: 'post',
        data
    })
}
//检查学工号是否存在
export function ifUserNumber(data) {
    return request({
        url: '/user/IfUserNumber',
        method: 'post',
        data
    })
}
export function ToRegister(data) {
    return request({
        url: '/user/Register',
        method: 'post',
        data
    })
}

//通过用户角色的到用户列表
export function SelectAllUserByNickname(nickname) {
    return request({
        url: '/user/SelectAllUserByNickname',
        method: 'get',
        params: { nickname }
    })
}
export function getTeacherOptions() {
    return request({
        url: '/user/getTeacherOptions',
        method: 'get',
    })
}
//通过学生姓名或者Id查询学生信息

export function selectStudentsByNameOrNumber(nameOrNumber) {
    return request({
        url: '/user/SelectStudentsByNameOrNumber',
        method: 'get',
        params: { nameOrNumber }
    })
}

//得到所有学生
export function getAllStudents() {
    return request({
        url: '/user/GetAllStudent',
        method: 'get',
    })
}
//得到用户数量list
export function getUserNumberList() {
    return request({
        url: '/user/GetUserNumberList',
        method: 'get',
    })
}
